
/* Font */

@font-face {
    font-family: 'oswald';
    src: url('../fonts/oswald-regular-webfont.woff2');
}

/* Colors */

$color-light: #119da4;
$color-main: #13505b;
$color-white: #ccc;
$color-black: #040404;
$color-type: #3c4859;

/* 样式重置 */

body {
    background-color: #f0f3f6;
    color: #666;
    font: 14px/1 'Helvetica Neue', Helvetica, Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

a {
    color: $color-type;
    transition: all 0.2s;
}

a,
a:visited {
    color: $color-type;
}

a:hover {
    color: $color-light;
}

.clearfix::after {
    clear: both;
    content: '';
    display: block;
    font-size: 0;
    height: 0;
    visibility: hidden;
}

/* 1px 下划线 */

.hairline::after {
    border: 0 solid #ebedf0;
    border-bottom-width: 1px;
    bottom: -50%;
    box-sizing: border-box;
    content: ' ';
    left: -50%;
    pointer-events: none;
    position: absolute;
    right: -50%;
    top: -50%;
    transform: scale(0.5);
}

/* Container */

.container {
    max-width: 1200px;
    padding: 0 20px;
}

/* Header */

.header {
    display: flex;
    height: 120px;
    justify-content: space-between;

    .header-type {
        align-items: center;
        display: flex;
        font-size: 20px;
        font-weight: 700;
        line-height: 80px;
        padding-left: 5px;

        .avatar {
            margin-right: 10px;
        }

        a {
            color: $color-type;
            font-family: 'oswald', sans-serif;
            margin-top: -4px;
        }

        .page-title {
            font-size: 18px;
            font-weight: 300;
            margin-left: 10px;
        }
    }

    .header-menu {
        align-items: center;
        display: flex;
        flex: 1;
        justify-content: flex-end;
        
        &-inner {
            line-height: 40px;
            margin-right: 5px;

            a {
                border-radius: 5px;
                color: $color-type;
                font-size: 14px;
                padding: 10px;
            }
    
            a:hover {
                background: $color-type;
                color: #fefefe;
            }
        }

        &-social {
            display: flex;

            a {
                align-items: center;
                display: flex;
                fill: $color-type;
                padding: 0 5px;
            }

            a:hover {
                fill: $color-light;
            }
        }

    }

    .header-menu-mobile {
        display: none;
        flex-direction: column;
        justify-content: center;

        &-inner {
            .icon {
                color: $color-type;
                height: 25px;
                width: 25px;
            }

            .icon-menu::before {
                box-shadow: 0 -0.5em, 0 0.5em;
            }
        }
    }
}

.header-menu-mobile-menu {
    display: none;
    height: 100vh;
    left: 0;
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 2000;

    &-bg {
        background: #fff;
        height: 100vh;
        left: 0;
        position: absolute;
        top: 0;
        width: 100%;
    }

    &-wrap {
        align-items: center;
        display: flex;
        height: 100vh;
        justify-content: center;
        width: 100%;
    }

    &-inner {
        position: relative;
        width: 70%;
    }

    &-list {
        align-items: center;
        display: flex;
        flex-direction: column;
        justify-content: center;

        a {
            font-size: 18px;
            line-height: 40px;
        }
    }

    &-close {
        bottom: -50px;
        height: 25px;
        left: 50%;
        margin-left: -12px;
        position: absolute;
        width: 25px;

        .icon {
            color: $color-type;
            height: 25px;
            width: 25px;
        }
    }
}

.mobile-menu-fixed {
    position: fixed;
    width: 100%;
}

/* 主体框架 */
.main {
    min-height: 500px;
    position: relative;

    .inner {
        padding-right: 300px;
        // .inner-main {}
    }
}

/* 边栏 */

.sidebar {
    position: fixed;
    right: calc((100% - 1160px) / 2);
    top: 120px;
    transition: all 0.2s;
    width: 280px;

    .widget {
        background: #fff;
        border-radius: 8px;
        margin-bottom: 10px;
        max-height: calc(100vh - 100px);
        overflow-y: scroll;
        padding: 20px;

        .widget-wrap {
            //   padding-top: 20px;
            &:first-child {
                padding-top: 0;
            }

            &:last-child {
                .widget-inner {
                    margin-bottom: 0;
                }
            }

            .widget-title {
                color: $color-white;
                font-family: 'oswald', sans-serif;
                font-size: 16px;
                font-weight: 300;
                text-transform: uppercase;
            }

            .widget-inner {
                margin-bottom: 10px;
                padding: 10px 0;

                ul {
                    margin: 0;

                    li {
                        line-height: 22px;
                        list-style: none;
                        margin: 0;
                    }
                }
            }
        }

        .widget-cate,
        .widget-archive {
            li {
                padding: 0 0 0 12px;
                position: relative;
            }

            li::before {
                background: $color-main;
                content: '';
                height: 14px;
                left: 0;
                position: absolute;
                top: 4px;
                width: 3px;
            }
        }

        .widget-tags {
            .tag-list {
                .tag-list-item {
                    border: 1px dashed $color-white;
                    border-radius: 3px;
                    box-sizing: border-box;
                    display: inline-block;
                    line-height: 24px;
                    margin-bottom: 10px;
                    margin-right: 10px;
                    padding: 0 8px;
                    transition: all 0.2s;

                    a {
                        color: $color-white;
                    }
                }

                .tag-list-item:hover {
                    border-color: $color-main;

                    a {
                        color: $color-main;
                    }
                }
            }
        }

        .widget-recent-posts {
            li {
                padding: 0 0 5px 12px;
                position: relative;
            }

            li::before {
                background: $color-light;
                border-radius: 2px;
                content: '';
                height: 5px;
                left: 0;
                position: absolute;
                top: 8.5px;
                width: 5px;
            }
        }
    }

}

#backtop {
    background: #fff;
    border-radius: 8px;
    cursor: pointer;
    display: none;
    font-size: 0.7rem;
    font-weight: 300;
    padding: 15px 0;
    text-align: center;
}

.sidebar-fixed {
    top: 20px;
}

/* 首页 */
.index {
    margin-bottom: 60px;

    .article {
        background: #fff;
        border-radius: 8px;
        margin-bottom: 20px;
        padding: 20px;

        .article-inner {
            display: flex;

            .article-feature {
                flex: 0 0 260px;
                margin-right: 20px;
                position: relative;

                a {
                    border-radius: 5px;
                    display: block;
                    overflow: hidden;
                    position: relative;

                    img {
                        display: block;
                        height: auto;
                        transition: all 0.3s ease-in-out;
                        width: 100%;
                    }
                }

                a::before {
                    background-color: rgba(#000, 0.16);
                    bottom: 0;
                    content: '';
                    left: 0;
                    position: absolute;
                    right: 0;
                    top: 0;
                    transition: all 0.8s ease 0s;
                    z-index: 1;
                }

                a:hover {
                    img {
                        transform: scale(1.05);
                    }
                }

                a:hover::before {
                    opacity: 0;
                }
            }

            .article-body {
                flex: 1;
                overflow: hidden;
                text-overflow: ellipsis;

                .article-title {
                    font-size: 1rem;
                    font-weight: 500;
                    padding: 0 0 10px;

                    a {
                        color: $color-type;
                        line-height: 1.3;

                        &:hover {
                            color: $color-main;
                        }
                    }
                }

                .article-entry {
                    font-weight: 300;
                }
            }
        }

        .article-footer {
            display: flex;
            justify-content: flex-end;
            padding: 20px 0 0;
            // font-family: 'oswald', sans-serif;
            
            .article-more-info {
                display: flex;

                .article-date {
                    align-items: center;
                    border-left: 3px solid $color-light;
                    color: $color-white;
                    display: flex;
                    margin-left: 10px;
                    padding-left: 8px;
                }

                .article-category {
                    align-items: center;
                    border-left: 3px solid $color-light;
                    display: flex;
                    margin-left: 10px;
                    padding-left: 8px;
                }

                .article-tag {
                    align-items: center;
                    border-left: 3px solid $color-light;
                    display: flex;
                    margin-left: 10px;
                    padding-left: 8px;

                }

                .article-tag-list {
                    display: flex;
                    margin: 0;

                    li {
                        list-style: none;
                        margin: 0 3px 0 0;
                    }
                }
            }

            a {
                color: $color-white;

                &:hover {
                    color: $color-type;
                }
            }
        }

        // Tweet
        .article-tweet {
            position: relative;

            &-quote {
                height: 50px;
                left: 0;
                position: absolute;
                top: 0;
                width: 50px;
            }

            &-content {
                padding: 10px 0 10px 80px;

                p {
                    font-weight: 300;
                    margin: 0;
                }
            }

            .article-footer {
                justify-content: start;
                padding-left: 70px;

                &-common {
                    align-items: center;
                    border-left: 3px solid $color-light;
                    display: flex;
                    margin-left: 10px;
                    padding-left: 5px;
                }
            }
        }
    }
}

/* 文章内页 */
.post,
.tweet {
    margin-bottom: 60px;

    .article {
        background: #fff;
        border-radius: 8px;
        box-shadow: 0 8px 12px #ebedf0;
        margin-bottom: 20px;
        padding: 20px;
        position: relative;

        .article-gallery {
            a {
                display: block;
                margin-bottom: 0.5rem;

                img {
                    width: 100%;
                }
            }
        }

        .article-title {
            font-size: 1.4rem;
            font-weight: 300;
            padding-top: 10px;

            a {
                color: $color-type;

                &:hover {
                    color: $color-main;
                }
            }
        }

        .article-entry {
            padding-bottom: 60px;
            position: relative;
        }

        .article-more-info {
            display: flex;
            margin-bottom: 30px;
            padding: 0 0 30px;
            position: relative;

            &-tweet {
                padding-bottom: 20px;
            }

            .article-date {
                align-items: center;
                border-left: 3px solid $color-light;
                color: $color-white;
                display: flex;
                margin-right: 10px;
                padding-left: 8px;
            }

            .article-category {
                align-items: center;
                border-left: 3px solid $color-light;
                display: flex;
                margin-right: 10px;
                padding-left: 8px;
            }

            .article-tag {
                align-items: center;
                border-left: 3px solid $color-light;
                display: flex;
                margin-right: 10px;
                padding-left: 8px;

                .article-tag-list {
                    display: flex;
                    margin: 0;

                    li {
                        list-style: none;
                        margin: 0 3px 0 0;
                    }
                }
            }
            
            .article-busuanzi {
                align-items: center;
                border-left: 3px solid $color-light;
                color: $color-white;
                display: flex;
                margin-right: 10px;
                padding-left: 8px;
            }

            a {
                color: $color-white;

                &:hover {
                    color: $color-type;
                }
            }
        }

        .article-nav {
            display: flex;
            justify-content: space-between;
            padding: 30px 0;

            .article-nav-link-wrap {
                .article-nav-caption {
                    color: $color-white;
                    font-size: 12px;
                    margin-bottom: 5px;
                }

                .article-nav-title {
                    font-size: 16px;
                    line-height: 1.6;
                }
            }
        }

        .article-copyright {
            padding: 25px 0;
            position: relative;

            p {
                border-left: 3px solid $color-light;
                font-size: 13px;
                line-height: 1.6;
                margin: 0;
                padding-left: 5px;
            }
        }

        .article-refer,
        .article-reprint {
            padding: 25px 0;
            position: relative;

            p {
                border-left: 3px solid $color-light;
                font-size: 13px;
                line-height: 1.6;
                margin-bottom: 10px;
                padding-left: 5px;
            }

            p:last-child {
                margin-bottom: 0;
            }
        }

        .article-refer {
            padding: 25px 0;
            position: relative;

            h3 {
                color: $color-black;
                font-size: 16px;
                font-weight: 300;
                margin-bottom: 15px;
            }
        }

        .share {
            margin-left: -3.5rem;
            position: fixed;
            top: 10rem;

            .share-title {
                color: #aaa;
                font-size: 13px;
                padding-bottom: 10px;
                text-align: center;
            }

            .share-item {
                align-items: center;
                background-color: #fff;
                border-radius: 50%;
                box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.04);
                display: flex;
                fill: $color-type;
                height: 2rem;
                justify-content: center;
                margin-bottom: 10px;
                transition: all 0.3s;
                width: 2rem;

                &:hover {
                    fill: $color-light;
                }
            }
        }
    }
}

.archives-wrap {
    background: #fff;
    border-radius: 8px;
    margin-bottom: 20px;
    padding: 20px;

    .archive-year-wrap {
        padding-bottom: 8px;

        a {
            color: $color-white;
            font-size: 14px;

            &:hover {
                color: $color-main;
            }
        }
    }

    .archive-article {
        h1 {
            color: $color-type;
            font-size: 14px;
            font-weight: 400;
            line-height: 22px;
            margin: 0;
        }
    }
}

.footer {
    background: $color-type;
    font-family: 'oswald', sans-serif;
    font-size: 13px;
    width: 100%;

    .footer-inner {
        display: flex;
        justify-content: space-between;
        margin: 0 auto;
        max-width: 1200px;
        padding: 0 20px;

        .footer-info {
            align-items: center;
            color: $color-white;
            display: flex;

            span {
                line-height: 20px;
                margin-right: 5px;
                user-select: none;
            }
        }

        .footer-powered {
            color: $color-white;
            line-height: 4rem;
            user-select: none;
        }

        a {
            color: $color-white;
            text-decoration: underline;
        }
    }
}

.pagination {
    font-size: 14px;
    justify-content: center;
    padding: 20px 0 0;

    .page-number {
        color: $color-main;
        padding: 10px;

        &:hover {
            color: $color-light;
        }

        &.current {
            color: $color-white;
            cursor: not-allowed;
        }
    }

    .extend {
        padding: 10px;

        &:hover {
            color: $color-light;
        }
    }
}

/* import */
@import './page';
@import './media-fixed';
